package com.df.tv.launcher.params;

import com.df.tv.launcher.alternative.AppInfo;
import com.telecom.tv189.comlib.params.AbsComParams;
import com.telecom.tv189.comlib.util.Attributes;

/**
 * Class for storage constant string
 * 
 * @author liubaolin
 * 
 */
public class ComParams extends AbsComParams {
    /*
     * Setting interface relative action for start Activity
     */
    public static final String ACCOUNT_ACTION = "com.telecom.tv189.launcher.action.SETTING_ACCOUNT";
    public static final String NETWORK_SETTING_ACTION = "com.telecom.tv189.launcher.action.SETTING_NETWORK";
    public static final String DISPLAY_SETTING_ACTION = "com.telecom.tv189.launcher.action.SETTING_DISPLAY";
    public static final String SOUND_SETTING_ACTION = "com.telecom.tv189.launcher.action.SETTING_AUDIO";
    public static final String TASK_MANAGEMENT_ACTION = "com.telecom.tv189.launcher.action.SETTING_TASKS";
    public static final String MULTI_SCREEN_ASSISTANT_ACTION = "com.telecom.tv189.launcher.action.SETTING_MULTISCREEN";
    public static final String SYSTEM_UPGRADE_ACTION = "com.telecom.tv189.launcher.action.SETTING_UPGRADE";
    public static final String HELP_CENTER_ACTION = "com.telecom.tv189.launcher.action.SETTING_HELP";
    public static final String ABOUT_ACTION = "com.telecom.tv189.launcher.action.SETTING_ABOUT";
    public static final String USB_OPERATION_ACTION = "com.telecom.tv189.launcher.action.SETTING_USB";
    /*
     * Application interface relative operation for start Activity
     * 
     * Install、uninstall、delete、open A application
     */
    public static final String APP_REDIRECT_ACTION = "com.telcom.tv189.action.AppAction";
    public static final String GET_APP_SERVICE_ACITON = "com.telecom.tv189.service.AppInfoMgrService";
    public static final String INSTALL_APPLICATION = "com.telecom.tv189.launcher.action.APP_INSTALL";
    public static final String UNINSTALL_APPLICATION = "com.telecom.tv189.launcher.action.APP_UNISTALL";
    public static final String DELETE_APPLICATION = "com.telecom.tv189.launcher.action.APP_DELETE";
    public static final String OPEN_APPLICATION = "com.telecom.tv189.launcher.action.APP_OPEN";
    public static final String NOT_ALLOW_TO_DELETE_APPLICATION = "com.telecom.tv189.launcher.action.APP_NOT_ALLOWED_TO_DELETE";
    public static final String APPLICATION_NOT_INSTALLED = "com.telecom.tv189.launcher.action.APP_NOT_INSTALLED";
    public static final int FLAG_FOR_INSTALL_APPLICATION = 0;
    public static final int FLAG_FOR_UNINSTALL_APPLICATION = 1;
    public static final String APP_APPLICATION_ACTION_TYPE = "ACTION_KEY";
    public static final String APP_APPLICATION_ACTION_DATA = "TARGET_APP_KEY";

    /*
     * HttpComParams
     */
    public static final String URL_HOST = "http://api.socialott.tv189.cn/";

    public static final String CLIENT_TYPE = "1";
    public static final String PCODE = "2";

    public static final String PROP_HOST_URL = "persist.tv189.app.host_url";

    public static final String LOG_TAG = "TV189Launcher";

    public static final int CLICK_LOG_CACHE = 100;

    public static final String CASE_V4 = "v4";
    public static final String CASE_V5 = "v5";

    public static final String VERSION_4X = "4.";
    public static final String VERSION_5X = "5.";

    public static final String NAV_ITEM_PATH = "100251660/4193_100251660_utf8.inc";
    //public static final String NAV_ITEM_PATH = "100215237/menu2014_utf8.inc";

    public static final String SCOLL_MSG_PATH = "100251660/4195_100251660_utf8.inc";
    //public static final String SCOLL_MSG_PATH = "100215237/msg2014_utf8.inc";

    private static final ComParams sIntance = new ComParams();

    private ComParams() {
        mAttr = new Attributes();
        mAttr.add(KEY_APP_ID, AppInfo.APP_ID);
        mAttr.add(KEY_DEV_ID, AppInfo.DEV_ID);
        mAttr.add(KEY_APP_SECRET, decodeSecret(AppInfo.APP_SECRET));
    }

    public static ComParams getInstance() {
        return sIntance;
    }

    public static String decodeSecret(String[] secrets) {
        return secrets[2] + secrets[1] + secrets[0] + secrets[3];
    }
}
